package com.qiudaozhang.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qiudaozhang.dto.ResponseCode;
import com.qiudaozhang.mapper.StgDAccountRecordMapper;
import com.qiudaozhang.model.StgDAccountRecord;
import com.qiudaozhang.service.StgDAccountRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
@Service
public class StgDAccountRecordServiceImpl implements StgDAccountRecordService {
    @Autowired
    private StgDAccountRecordMapper stgDAccountRecordMapper;


    @Override
    public ResponseCode query(Integer pageNum, Integer pageSize, String time1,String time2) {
        PageHelper.startPage(pageNum,pageSize);
        ResponseCode code  =  new ResponseCode();
        List<StgDAccountRecord> list = stgDAccountRecordMapper.query(time1,time2);
        PageInfo<StgDAccountRecord> p=new PageInfo<>(list);
        code.setData(list);
        code.setCount(p.getTotal());
        code.setCode(0);
        return code;
    }
}
